package www.ld.com.domain.category.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import www.ld.com.core.group.InsertGroup;
import www.ld.com.core.group.UpdateGroup;
import www.ld.com.dictionary.ShowStatusEnum;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Accessors(chain = true)
@ToString
@EqualsAndHashCode
public class InCategoryVO {
    @ApiModelProperty(value = "ID")
    @NotNull(message = "分类ID不能为空", groups = UpdateGroup.class)
    private String id;

    @ApiModelProperty(value = "上级分类ID")
    private String parentId;

    @ApiModelProperty(value = "分类名称")
    @NotBlank(message = "分类名称不能为空")
    @Length(max = 50, min = 2, message = "分类名称必须是{min}~{max}个字符", groups = {UpdateGroup.class, InsertGroup.class})
    private String name;

    @ApiModelProperty(value = "分类排序")
    @Range(max = 100, message = "分类排序不能大于{max}", groups = {UpdateGroup.class, InsertGroup.class})
    private Integer sort;

    @ApiModelProperty(value = "分类级别")
    @Range(max = 100, message = "分类级别不能大于{max}", groups = {UpdateGroup.class, InsertGroup.class})
    private Integer level;

    @ApiModelProperty(value = "icon图标")
    @Length(max = 255, message = "icon图标不能大于{max}个字符", groups = InsertGroup.class)
    private String icon;

    @ApiModelProperty(value = "显示状态")
    @NotNull(message = "显示状态不能为空", groups = {UpdateGroup.class, InsertGroup.class})
    private ShowStatusEnum showStatus;

}
